/**
 * 
 */
package com.archerdu.apply.dao.hibernate;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Example;
import org.hibernate.criterion.Order;

import com.archerdu.apply.dao.AdvertiseDAO;
import com.archerdu.apply.model.Advertise;
import com.archerdu.base.dao.HibernateBaseDao;
import com.archerdu.base.dao.IPage;

/**
 * @author archer
 * @version 1.0.0
 */
public class AdvertiseDAOImpl extends HibernateBaseDao<Advertise, String> implements AdvertiseDAO{

	private static final long serialVersionUID = -7581594053093787176L;


	@Override
	public IPage<Advertise> pageSearch(Advertise entity, int pageNo,
			int pageSize) {
		DetachedCriteria criteria = getCriteria();
		criteria.add(Example.create(entity));
		criteria.addOrder(Order.desc("createtime"));
		return pageSearch(criteria, pageNo, pageSize);	
	}
	
}
